package com.wlzg.collectiontool.view

import android.content.Context
import android.view.View
import androidx.lifecycle.lifecycleScope
import com.lxj.xpopup.core.CenterPopupView
import com.lxj.xpopup.core.PositionPopupView
import com.wlzg.collectiontool.R
import kotlinx.android.synthetic.main.dia_sousuo.view.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

class SousuoDia(var mContext:Context,var mFragment:InvestMapFragment) : PositionPopupView(mContext),
    View.OnClickListener {
    override fun getImplLayoutId(): Int {
        return R.layout.dia_sousuo
    }

    override fun onCreate() {
        super.onCreate()
        diss.setOnClickListener(this)
        chaxun.setOnClickListener(this)


    }

    override fun onClick(p0: View?) {
        when(p0?.id){
            R.id.diss->{
                dismiss()
            }
            R.id.chaxun->{
                query()
                dismiss()
            }
        }
    }
    fun query(){
       val code= sousuobh.text.toString()
        if (code!=null&&!code.isEmpty()){
            mFragment.queryPointbycode(code)
        }
    }
}